
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>用户中心</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="fly,layui,前端社区">
  <meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区，致力于为web开发提供强劲动力">
  <link rel="stylesheet" href="../../static/res/layui/css/layui.css">
  <link rel="stylesheet" href="../../static/res/css/global.css">
</head>
<body>

<div class="fly-header layui-bg-black">
  <div class="layui-container">
    <a class="fly-logo" href="/">
      <img src="../../static/res/images/logo.png" alt="layui">
    </a>
    <ul class="layui-nav fly-nav layui-hide-xs">
    </ul>

    <ul class="layui-nav fly-nav-user">
      <!-- 登入后的状态 -->
      <li class="layui-nav-item">
        <a class="fly-nav-avatar" href="javascript:;">
          <cite class="layui-hide-xs">{{user.nick_name}}</cite>
          <i class="iconfont icon-renzheng layui-hide-xs" title="认证信息：南神认证"></i>
            {%if user.is_vip != 0%}
          <i class="layui-badge fly-badge-vip layui-hide-xs">VIP{{user.is_vip}}</i>
            {%endif%}
          <img src="{{user.avatar_url}}">
        </a>
        <dl class="layui-nav-child">
          <dd><a href="/user/set"><i class="layui-icon">&#xe620;</i>基本设置</a></dd>
          <dd><a href="/user/message"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a></dd>
          <dd><a href="/user/home?u={{user.id}}"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a></dd>
          <hr style="margin: 5px 0;">
          <dd><a href="/user/logout" style="text-align: center;">退出</a></dd>
        </dl>
      </li>
    </ul>
  </div>
</div>

<div class="layui-container fly-marginTop fly-user-main">
  <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">
    <li class="layui-nav-item">
      <a href="/user/home?u={{user.id}}">
        <i class="layui-icon">&#xe609;</i>
        我的主页
      </a>
    </li>
    <li class="layui-nav-item">
      <a href="/user/index">
        <i class="layui-icon">&#xe612;</i>
        用户中心
      </a>
    </li>
    <li class="layui-nav-item">
      <a href="/user/set">
        <i class="layui-icon">&#xe620;</i>
        基本设置
      </a>
    </li>
          <li class="layui-nav-item icon-tiezi">
      <a href="/user/user_message">
        <i class="layui-icon">&#xe621;</i>
        我的贴子
      </a>
    </li>
    <li class="layui-nav-item">
      <a href="/user/collect">
        <i class="layui-icon">&#xe600;</i>
        我的收藏
      </a>
            <li class="layui-nav-item  layui-this">
      <a href="/user/follow">
        <i class="layui-icon">&#xe654;</i>
        我的关注
      </a>
    </li>
    </li>
           <li class="layui-nav-item">
      <a href="/user/fly_kiss">
        <i class="layui-icon">&#xe657;</i>
        飞吻商城
      </a>
    </li>
  </ul>

  <div class="site-tree-mobile layui-hide">
    <i class="layui-icon">&#xe602;</i>
  </div>
  <div class="site-mobile-shade"></div>

  <div class="site-tree-mobile layui-hide">
    <i class="layui-icon">&#xe602;</i>
  </div>
  <div class="site-mobile-shade"></div>
  <div class="fly-panel fly-panel-user" pad20>

<!--?在这里可以for-->
{%for i in follow%}
<div class="layui-col-md6" style="border:1px solid #cee3e9;width: 40%; height: 180px; margin-left: 30px; margin-top: 20px">
            <a href="/user/home?u={{i.id}}">
    <div class="fly-panel fly-panel-border">
        <div class="fly-panel-main layui-text" style="padding: 18px 5px; height: 50px; line-height: 26px;text-align: center">
            <img src="{{i.avatar_url}}" style="width: 100px;height: 100px; border-radius:50px;overflow: hidden;margin-top: -13px"alt="">
      <p>{{i.nick_name}}</p>
            </a>
            <div class="fly-sns" data-user="">
    <a href="javascript:;" class="layui-btn layui-btn-primary fly-imActive" data-type="addFriend" onclick="aaa({{i.id}})" title="点击取消关注">已关注</a>
            </div>
        </div>
    </div>
</div>

{%endfor%}

        <div >
            <div style="border-top: 1px dotted #e2e2e2;margin-left: 30px">
            <div class="laypage-main">
                {%if page.page != 1%}
                <a href="/user/follow?page=1" class="laypage-last" title="首页">首页</a>
                {%endif%}
                {%if page.has_prev%}
                <a href="/user/follow?page={{page.prev_num}}" class="laypage-prev">上一页</a>
                {%endif%}
                 <span class="laypage-curr">{{page.page}}</span>
                {%if page.page + 1 <= page.pages%}
                <a href="/user/follow?page={{page.page+1}}">{{page.page+1}}</a>
                {%endif%}
                {%if page.page + 2 <= page.pages%}
                <a href="/user/follow?page={{page.page+2}}">{{page.page+2}}</a>
                {%endif%}
                {%if page.page + 3 <= page.pages%}
                <a href="/user/follow?page={{page.pgae+3}}">{{page.page+3}}</a>
                {%endif%}
                {%if page.page + 4 <= page.pages%}
                <a href="/user/follow?page={{page.pgae+4}}">{{page.page+4}}</a>
                {%endif%}
                  <span>…</span>
                {%if page.page < page.pages%}
                  <a href="/user/follow?page={{page.pages}}" class="laypage-last" title="尾页">尾页</a>
                {%endif%}
                {%if page.has_next%}
                 <a href="/user/follow?page={{page.next_num}}" class="laypage-next">下一页</a>
                {%endif%}

             </div></div></div>

  </div></div>

<div class="fly-footer">
  <p><a href="http://fly.layui.com/" target="_blank">Fly社区</a> 2017 &copy; <a href="http://www.layui.com/" target="_blank">layui.com 出品</a></p>
  <p>
    <a href="http://fly.layui.com/jie/3147/" target="_blank">付费计划</a>
    <a href="http://www.layui.com/template/fly/" target="_blank">获取Fly社区模版</a>
    <a href="http://fly.layui.com/jie/2461/" target="_blank">微信公众号</a>
  </p>
</div>

<script src="../../static/res/layui/layui.js"></script>
<script src="../../static/js/jquery-3.3.1.js"></script>
<script>
    function aaa(e){
        var params = {
            "follow_id": e
        };
        $.ajax({
            url: "/user/follow",
            type: "post",
            data: JSON.stringify(params),
            contentType: "application/json",
            success: function (resp) {
                if (resp.errno == "0") {
                   location=location
                }
                else {
                    alert(resp.msg)
                }
    }})    }
layui.cache.page = 'user';
layui.cache.user = {
  username: '游客'
  ,uid: -1
  ,avatar: '../../res/images/avatar/00.jpg'
  ,experience: 83
  ,sex: '男'
};
layui.config({

  base: '../../static/res/mods/'
}).extend({
  fly: 'index'
}).use('fly');
</script>

</body>
</html>